{include file="public/layout"/}
<body data-type="generalComponents">
<div class="tpl-content-wrapper js-check-wrap">
    <ol class="am-breadcrumb">
        <li><a href="javascript:void(0)" onclick="javascript:parent.openItem('welcome|Index');" class="am-icon-home">首页</a></li>
        <li class="am-active">权限</li>
        <li class="am-active">权限资源列表</li>
    </ol>
    <div class="tpl-portlet-components">
        <div class="tpl-block">
            <form method="post">
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-md-6">&nbsp;</div>
                    <div class="am-u-sm-12 am-u-md-3">
                        <div class="am-form-group">
                            <select name="type" data-am-selected="{btnSize: 'sm'}">
                                {volist name="modules" id="module"}
                                    <option value="{$key}" {if condition="isset($_GET['type']) && $_GET['type'] eq $key"}selected{/if}>{$module.title}({$module.name})</option>
                                {/volist}
                            </select>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-3">
                        <div class="am-input-group am-input-group-sm">
                            <input type="text" class="am-form-field" name="name" placeholder="搜索相关数据" value="{$Request.param.name}">
                            <span class="am-input-group-btn">
                                <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit"></button>
                            </span>
                        </div>
                    </div>
                </div>
            </form>
            <form class="js-ajax-form" method="post">
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-md-6">
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                {$action|actionList|raw}
                            </div>
                        </div>
                    </div>
                </div>
                <input type="hidden" name="act" value="del">
                <div class="am-g">
                    <div class="am-u-sm-12">
                        <form class="am-form">
                            <table class="am-table am-table-striped am-table-hover table-main">
                                <thead>
                                <tr>
                                    <th class="table-id" style="width: 150px;">名称</th>
                                    <th class="table-title" style="width: 200px;">资源类型</th>
                                    <th class="table-type" style="width: 300px;">所属分组</th>
                                    <th class="table-author am-hide-sm-only">权限码</th>
                                    <th class="table-set">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {volist name="right_list" id="v"}
                                <tr>
                                    <td>{$v.name}</td>
                                    <td>{$modules[$v.type]['title']}</td>
                                    <td>{$group[$v['group']]}</td>
                                    <td class="am-hide-sm-only am-text-middle">{$v.right|str_substr=60,'...'}</td>
                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a class="am-btn am-btn-default am-btn-xs am-text-secondary" href="{:url('system/edit_right', array('id'=>$v['id'], 'type'=>$v['type']))}"><i class="am-icon-pencil-square-o"></i> 编辑</a>
                                                <a class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only js-ajax-delete" href="{:url('system/right_del', array('id'=>$v['id'], 'act'=>'del'))}" data-msg="确定要删除吗？"><i class="am-icon-trash-o"></i> 删除</a>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </form>
                    </div>

                </div>
            </form>
        </div>
        <div class="tpl-alert"></div>
    </div>
</div>

<script src="__ADMIN__/js/admin.js"></script>
</body>
</html>